import { http } from "../utils/axios.js"

// 轮播
export function song()
{
	return http('/api/bannerList','get')
}

// 获取商品
export function getcommodity()
{
	return http('/api/goods/is_new/1','get')
}

// 获取为你推荐
export function getrecommend()
{
	return http('/api/goods/is_recommend/1','get')
}

// 商品详情
export function recommendabout(id)
{
	return http(`/api/goods/detail/${id}`,'get')
}

// 获取mac
export function getmaccommodity(id)
{
	return http(`/api/goods/getMenuGoodsList/1/${id}`,'get')
}

// 登录
export function login(data)
{
	return http('/api/login','post',data)
}

// 搜索
export function search(name)
{
	return http(`/api/goods/search/1/${name}`,'get')
}

// 获取购物车
export function getshopcar(data)
{
	return http('/api/getCartList?member_id='+data,'get')
}

// 添加购物车
export function addshopcar(data)
{
	return http(`/api/addcart?member_id=${data.member_id}&goods_id=${data.goods_id}&goods_name=${data.goods_name}&price=${data.price}&number=${data.number}&sku_id=${data.sku_id}&sku_pname=${data.sku_pname}&sku_sname=${data.sku_sname}&goods_img=${data.goods_img}&remark=${data.remark}`,'post')
}

// 删除购物车
export function deleteshopcar(data)
{
	return http(`/api/deletecart?id=`+data,'get')
}

// 清空购物车
export function alldeleteshopcar(data)
{
	return http(`/api/clearcart?member_id=`+data,'get')
}